<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
{{ my_dict.c }}

{# 奇偶行列表输出 #}
<ul>
    {% for i in my_dict.c%}
        {% if  forloop.counter|divisibleby:"2" %}
            <li style="color: red">{{ forloop.counter }} {{ i|add:'100' }}</li>
        {% else %}
            <li style="color: green">{{ forloop.counter }} {{ i|add:'100' }}</li>
        {% endif %}
    {% endfor %}
</ul>

<p>打印九九方阵</p>


{# my_dict.f是一个range(1,10)的列表 #}
<p>my_dict.f列表：{{ my_dict.f }}}</p>
<table border="1px solid">
    {% for x in my_dict.f %}
        {% if x|divisibleby:"2" %}
            <tr style="color: red">
                {% for y in my_dict.f %}
                    <td>{{x}} * {{ y }} = {% widthratio x 1 y%}</td>
                {% endfor %}
            </tr>
        {% else %}
            <tr style="color: green">
                {% for y in my_dict.f %}
                    <td>{{x}} * {{ y }} = {% widthratio x 1 y%}</td>
                {% endfor %}
            </tr>
        {% endif %}
    {% endfor %}
</table>

</body>
</html>
